package com.ocpap.rest.serviceImpl;

import com.ocpap.rest.entity.SysUser;
import com.ocpap.rest.mapper.SysUserMapper;
import com.ocpap.rest.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public int insert(SysUser sysUser) {
        return sysUserMapper.insertSelective(sysUser);
    }

    @Override
    public int update(SysUser sysUser) {
        return sysUserMapper.updateByPrimaryKeySelective(sysUser);
    }

    @Override
    public SysUser findByPassAndAccount(SysUser sysUser) {
        return sysUserMapper.findByPassAndAccount(sysUser);
    }

    @Override
    public List<SysUser> findAll(SysUser sysUser) {
        return sysUserMapper.findAll(sysUser);
    }

    @Override
    public SysUser findById(Integer id) {
        return sysUserMapper.selectByPrimaryKey(id);
    }

}
